<?php
declare (strict_types=1);

namespace app\user\model\user;

use app\common\model\BaseModel;
use app\user\logic\user\FacePic;

/**
 * 人脸数据模型
 */
class FaceVerify extends BaseModel
{
    /**
     * 表名
     *
     * @var string
     */
    protected $name = 'user_face_verify';

    /**
     * 定义表主键
     *
     * @var string
     */
    protected $pk = 'id';

    /**
     * 设置自动写入时间
     *
     * @var boolean
     */
    protected $autoWriteTimestamp = true;

    protected $updateTime = false;

    /**
     * 时间显示格式
     *
     * @var string
     */
    protected $dateFormat = 'Y-m-d H:i';

    /**
     * 人脸照片地址
     * Author: Martinsun <syh@sunyonghong.com>
     * Date: 2021/12/7
     *
     * @return \think\model\relation\BelongsTo
     */
    public function attachUrl()
    {
        return $this->belongsTo(FacePic::class, 'attach_id')->bind(['attach_url' => 'fileurl']);
    }

}
